package com.yjt.gcss.gddw.common.bean.domain;

import java.util.HashMap;

import com.yjt.common.tools.FormatUtil;
import com.yjt.common.tools.TimeUtil;

/**
 * TxnSsds entity. @author MyEclipse Persistence Tools
 */
public class TxnSsds extends AbstractTxnSsds implements java.io.Serializable {
	public static final String BEAN_PACKAGE_NAME = "com.yjt.gcss.gddw.common.bean.domain.TxnSsds";
	// Constructors
	private String tranTypeDesc;
	private String retCdDesc;
	private String createDateTimeDesc;
	private String rspDateTimeDesc;
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/** default constructor */
	public TxnSsds() {
	}

	/** minimal constructor */
	public TxnSsds(String reqMsgId, String entrustDate, String txnType,
			String orgId, String userNo, String origBank, String origAcc,
			String outAccBank, String payerAcc, String payerName,
			String tranType, String privateFlag, String currency, String amout,
			String status, String createDate, String createTime, String source, String resendCount,String czCount) {
		super(reqMsgId, entrustDate, txnType, orgId, userNo, origBank, origAcc,
				outAccBank, payerAcc, payerName, tranType, privateFlag,
				currency, amout, status, createDate, createTime, source, resendCount,czCount);
	}

	/** full constructor */
	public TxnSsds(String reqMsgId, String entrustDate, String txnDate,
			String txnType, String orgId, String userNo, String origBank,
			String origAcc, String outBank, String outAccBank, String payerAcc,
			String payerName, String tranType, String privateFlag,
			String currency, String amout, String charge, String remark,
			String status, String retCd, String workReturnNo,
			String retCdRemark, String dzFlag, String dzDate, String reserve,
			String createDate, String createTime, String rspDate, String rspTime, String source, String oprName, String resendReqMsgId, String resendCount,String czCount) {
		super(reqMsgId, entrustDate, txnDate, txnType, orgId, userNo, origBank,
				origAcc, outBank, outAccBank, payerAcc, payerName, tranType,
				privateFlag, currency, amout, charge, remark, status, retCd,
				workReturnNo, retCdRemark, dzFlag, dzDate, reserve, createDate,
				createTime, rspDate, rspTime, source, oprName, resendReqMsgId, resendCount,czCount);
	}

	// 处理结果类型=返回结果说明(返回码)
	private static java.util.Map<String, String> status_map = null;
	private static java.util.Map<String, String> currency_map = null;
	private static java.util.Map<String, String> privateFlagDesc = null;
	private static java.util.Map<String, String> txnType_map = null;
	private static java.util.Map<String, String> dzFlag_map = null;
	// 存储复选框键值对，便于页面显示
	static {
		txnType_map = new HashMap<String, String>();
		txnType_map.put("100301", "实时代收");
		currency_map = new HashMap<String, String>();
		currency_map.put("CNY", "人民币");
		currency_map.put("HKD", "港币");
		currency_map.put("USD", "美元");
		status_map = new HashMap<String, String>();
		status_map.put("W", "待发送");
		status_map.put("A", "待回应");
		status_map.put("S", "成功");
		status_map.put("F", "失败");
		status_map.put("E", "错误");
		status_map.put("R", "已冲正");
		privateFlagDesc = new HashMap<String, String>();
		privateFlagDesc.put("S", "对私");
		privateFlagDesc.put("G", "对公");
		dzFlag_map = new HashMap<String, String>();
		dzFlag_map.put("D", "已对账");
		dzFlag_map.put("C", "待核查");
	}

	// *Desc用于页面显示
	public String getTxnTypeDesc() {
		return txnType_map.get(this.getTxnType());
	}

	public String getCurrencyDesc() {
		return currency_map.get(this.getCurrency());
	}

	public String getPrivateFlagDesc() {
		return privateFlagDesc.get(this.getPrivateFlag());
	}

	public String getStatusDesc() {
		return status_map.get(this.getStatus());
	}
	
	public String getAmountWithYuan() {
		return FormatUtil.fenToYuan(this.getAmout());
	}
	
	public String getDzFlagDesc() {
		return dzFlag_map.get(this.getDzFlag()); 
	}  

	//日期格式转换
	public String getEntrustDateDescr() {
		if(TimeUtil.checkDate(this.getEntrustDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getEntrustDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	
	public String getDzDateDescr() {
		if(TimeUtil.checkDate(this.getDzDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getDzDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	
	
	public String getOprTimeDescr() {
		if(TimeUtil.checkDate(this.getCreateDate()+this.getCreateTime(), "yyyyMMddHHmmss")) {
			return TimeUtil.changeStrTimeFormat(this.getCreateDate()+this.getCreateTime(), "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss");
		}
		return "";
	}
	
	public String getTxnDateDescr() {
		if(TimeUtil.checkDate(this.getTxnDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getTxnDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	
	public String getCreateDateDescr() {
		if(TimeUtil.checkDate(this.getCreateDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getCreateDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	
	public String getCreateTimeDescr() {
		if(TimeUtil.checkDate(this.getCreateTime(), "HHmmss")) {
			return TimeUtil.changeStrTimeFormat(this.getCreateTime(), "HHmmss", "HH:mm:ss");
		}
		return "";
	}

	public void setTranTypeDesc(String tranTypeDesc) {
		this.tranTypeDesc = tranTypeDesc;
	}
	
	public void setRetCdDesc(String retCdDesc) {
		this.retCdDesc = retCdDesc;
	}
	
	public String getCreateDateTimeDesc() {
		if(TimeUtil.checkDate(this.getCreateDate() + this.getCreateTime(), "yyyyMMddHHmmss")) {
			return TimeUtil.changeStrTimeFormat(this.getCreateDate() + this.getCreateTime(), "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss");
		}
		return "";
	}
	
	public String getRspDateTimeDesc() {
		if(TimeUtil.checkDate(this.getRspDate() + this.getRspTime(), "yyyyMMddHHmmss")) {
			return TimeUtil.changeStrTimeFormat(this.getRspDate() + this.getRspTime(), "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss");
		}
		return "";
	}
}
